﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link href="~/layui/css/layui.css" rel="stylesheet" />
    <link href="~/layuimini/css/public.css" rel="stylesheet" />
    <style>


    </style>
</head>
<body>
    <div class="layuimini-container">
        <div class="layuimini-main">
            <fieldset class="table-search-fieldset">
                <legend>一车间前道流程卡在产报表</legend>
                <div style="margin: 10px 10px 10px 10px">
                    <form class="layui-form layui-form-pane" action="" lay-filter="example">
                        <input type="hidden" name="State" value="1" id="State" />
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">开始日期</label>
                                <div class="layui-input-inline">
                                    <input type="text" id="BeginDate" autocomplete="off" class="layui-input" name="BeginDate" readonly="readonly">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">结束日期</label>
                                <div class="layui-input-inline">
                                    <input type="text" id="EndDate" autocomplete="off" class="layui-input" name="EndDate" readonly="readonly">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">关键字</label>
                                <div class="layui-input-inline">
                                    <input type="text" id="name" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
                            </div>
                        </div>
                    </form>
                </div>
            </fieldset>
            <script type="text/html" id="toolbarDemo">
                <div class="layui-btn-container">
                </div>
            </script>
            <table class="layui-hide" id="table" lay-filter="currentTableFilter"></table>
            <script type="text/html" id="currentTableBar">
            </script>
        </div>
    </div>
    <script src="~/layui/layui.js"></script>
    <script src="~/layuimini/js/lay-config.js"></script>
    <script>
        layui.use(['form', 'table', 'miniTab', 'laydate'], function () {
            var $ = layui.jquery,
                form = layui.form,
                table = layui.table,
                miniTab = layui.miniTab;
            laydate = layui.laydate,

            laydate.render({
                elem: '#BeginDate'
                , format: 'yyyy-MM-dd'
                , type: 'date'
                , trigger: 'click'
                , value: '@DateTime.Now.AddMonths(0).ToString("yyyy-MM-01")'
            });
            laydate.render({
                elem: '#EndDate'
                , format: 'yyyy-MM-dd'
                 , type: 'date'
               , trigger: 'click'
                 , value: '@DateTime.Now.AddMonths(0).ToString("yyyy-MM-dd")'
            });

        table.render({
            elem: '#table',
            method: 'post',
            url: '@Url.Action("IndexListReport1Async", "Bill1")',
            request: {
                pageName: 'PageIndex' //页码的参数名称，默认：page
               , limitName: 'PageSize' //每页数据量的参数名，默认：limit
            },
            where: {
                Search: $('#name').val(),
                BeginDate: form.val('example').BeginDate,
                EndDate: form.val('example').EndDate,
                State: $('#State').val()
            },
            cellMinWidth:120,
            toolbar: '#toolbarDemo',
            defaultToolbar: ['filter', 'exports', 'print'],
            cols: [[
                //{ type: "checkbox", width: 50 },
                { type: 'numbers', title: '序号', width: 50 },
                { field: 'ID', title: 'ID', width: 100, hide: true },
                { field: 'Code', title: '流程卡号', totalRowText:'合计'},
                //{ field: 'GoodsCode', title: '产品编码' },
                { field: 'GoodsName', title: '产品名称' },
                { field: 'GoodsModel', title: '产品型号' },
                { field: 'TouDate', title: '投片日期' },
                { field: 'JinDu', title: '当前进度' },
                { field: 'JinDuUser', title: '最后操作员' },
                { field: 'TouQty', title: '在产数量' },
                //{ field: 'JiaoQty', title: '交付数量' },
                //{ field: 'FailQty', title: '废品数量' },
                //{ field: 'JiaoRate', title: '成品率' },
                //{ field: 'DengJi', title: '质量等级' },
                //{ field: 'WaiXing', title: '封装外型' },
                //{ field: 'StateName', title: '状态' },
            ]],
            limits: [10, 20, 30, 50, 100, 100000000],
            limit: 20,
            page: true,
            //skin: 'line',
            totalRow: true,
            height: 'full-170',
            size:'sm',
        });

        // 监听搜索操作
        form.on('submit(data-search-btn)', function (data) {
            //执行搜索重载
            RefreshTable();
            return false
        });



        function RefreshTable() {
            table.reload('table', {
                where: {
                    Search: $('#name').val(),
                    BeginDate: form.val('example').BeginDate,
                    EndDate: form.val('example').EndDate,
                    State: $('#State').val()

                }
            }, 'data');

        }

    });
    </script>
</body>
</html>